package edu.ucla.whi.wanda;

import java.util.LinkedList;
import java.util.List;

import org.restlet.ext.wadl.ParameterInfo;
import org.restlet.ext.wadl.ParameterStyle;


public abstract class BaseItemListResource extends BaseResource {
	private String itemIdKey;

	protected String itemId;
	
	public BaseItemListResource(String itemIdKey) {
		super();
		
		this.itemIdKey = itemIdKey;
	}
	
	@Override
	protected void doInit() {
		super.doInit();
		
		itemId = (String) getRequestAttributes().get(itemIdKey);
	}
	
	@Override
	protected List<ParameterInfo> outputParams() {
		List<ParameterInfo> params = new LinkedList<ParameterInfo>();
		
		params.add(new ParameterInfo("query", true, "xsd:string", ParameterStyle.PLAIN, 
				"The query used to generated the list (for debug purpose)"));
		params.add(new ParameterInfo("next", true, "xsd:string", ParameterStyle.PLAIN, 
				"Token for the next page. NULL if reaches the end."));
		
		return params;
	}	
	
}